//获取cookie
export function getCookie(key) {
    let arr = document.cookie.split("; ");
    for (let i = 0; i < arr.length; i++) {
        let arr2 = arr[i].split("=");
        if (arr2[0] === key) {
            return decodeURI(arr2[1])
        }
    }
}

//设置cookie
export function setCookie(key, value, t = 60 * 60 * 60 * 12) {
    let oDate = new Date();
    oDate.setDate(oDate.getDate() + t);
    document.cookie = key + '=' + value + ';expries =' + oDate.toGMTString();
}

//删除cookie
export function removeCookie(key) {
    setCookie(key, -1)
}

//
export function generateCookieSession() {
    return 'NThjNzkzZjEtZTQxNC00NmRiLWFiM2YtMGRhMjE1N2Q3ZDNm'
}
